from pyecharts import options as opts
from pyecharts.charts import Pie
from pyecharts.faker import Faker

"""
    帮助文档：https://pyecharts.org/#/zh-cn/
"""

# 准备数据
lst = [['华子', 2000], ['果子', 3000], ['OPPO', 1500], ['VIVO', 1000]]
c = (
    Pie()
    .add('', lst)
    .set_global_opts(title_opts=opts.TitleOpts(title='标题'))
    .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}:{c}"))
    .render('phone.html')
)
